<?php
 mb_internal_encoding("utf-8");
 //gc_enabled();
 require "../../document/class_corpus.php";
 require "../../document/class_document.php";
 require "../../document/class_document_xml.php";
                
 require "../../files/tool_files_dirs.php";
                
 require "../../misc/class_tag.php";
 require "../../misc/tool_color.php";
                
 require "../../tree/class_tree.php";
 require "../../tree/class_tree_xhtml.php";
 require "../../tree/class_structure.php";
 require "../../tree/tool_tree.php";
                
 require "../../array/tool_array.php";
                
 require "../../maths/tool_maths.php";
                
 require "../../string/tool_string.php";
 require "../../string/class_segment.php";
                
 require "../../pdo/class_sql_document.php";

$lg_candidates=array("cs","da","de","el","en","es","et","fi","fr","hu","it","lt","lv","nl","pl","pt","sl","sw");
$dir="../../../Corpora/europa_complete_repair/";
//$dir="../../Corpora/debug/";
//$lg_candidates=array("en","da","fr");
$array_ids_europa=tool_corpus::get_unified_europa($dir,$lg_candidates);
$exp=new sql_experience("align_ecr_word");
$array_obj_sql=$exp->reader_experience();
$array_data=array();
foreach($lg_candidates as $lg){
  foreach($array_ids_europa as $id_europa){  
    $corpus=tool_corpus::get_corpus_regexp($dir,$id_europa."($lg)");
    $array_doc=$corpus->__get_array_doc();
    foreach($array_doc as $document){
      $long_id_doc=$document->__get_id();
      $explode=explode('/',$long_id_doc);
      $file=$explode[5];
      $contenu=$document->__get_container();
      $array_data[]=array(
        'path_doc'=>$file,
        'lg'=>$lg,
        'contenu'=>$contenu
      );
    }
    $array_obj_sql['sql_document']->writer_array_values($array_data);
    unset($array_data);
    $array_data=array();
  } 
}

die();


?>
